<?php

namespace app\api\model;

use app\common\model\Category as CategoryModel;

/**
 * 商品分类模型
 * Class Category
 * @package app\common\model
 */
class Category extends CategoryModel
{
    /**
     * 隐藏字段
     * @var array
     */
    protected $hidden = [
        'wxapp_id',
//        'create_time',
        'update_time'
    ];

    public static function getList() {

    }
    /**
     * undocumented function summary
     *
     * Undocumented function long description
     *
     * @param Type $var Description
     * @return type
     * @throws conditon
     **/
    public function detail($category_id)
    {
        echo 1;die;
        if (!$model = parent::detail($category_id)) {
            return null;
        }
        // 关联商品分类图片
        $model->setRelation('image', $model->getImage());
        // 关联商品分类图片
        $model->setRelation('img', $model->getImg());
        return $model;
    }
}
